From: Florian Müllner Date: Fri, 26 Oct 2012 10:34:45 +0000 (+0200) Subject: panelMenu: Fix exception when destroying menuless button X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5537 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6f5e5672bb9453c0cafd954993ec84a0b75b2696;p=gnome-shell.git panelMenu: Fix exception when destroying menuless button There's explicit API to create PanelMenu.Buttons with no menu, so guard against this case in destroy(). https://bugzilla.gnome.org/show_bug.cgi?id=686763 --- diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js index 939abbb48..bdfa465d3 100644 --- a/js/ui/panelMenu.js +++ b/js/ui/panelMenu.js @@ -214,7 +214,8 @@ const Button = new Lang.Class({ destroy: function() { this.actor._delegate = null; - this.menu.destroy(); + if (this.menu) + this.menu.destroy(); this.actor.destroy(); this.emit('destroy');